/**
 * Chengzai.com Inc.
 * Copyright (c) 2016-2018 All Rights Reserved.
 */
package com.auxgroup.hr.front.service.hireperson.impl;

import com.auxgroup.hr.front.commons.utils.ObjectFieldUtils;
import com.auxgroup.hr.front.dao.domain.PsCHireJyxyT;
import com.auxgroup.hr.front.dao.domain.PsCHireOutfT;
import com.auxgroup.hr.front.dao.domain.PsCHirePrimaryClass;
import com.auxgroup.hr.front.dao.repository.PsCHireJyxyTRepository;
import com.auxgroup.hr.front.dao.repository.PsCHireOutfTRepository;
import com.auxgroup.hr.front.service.hireperson.HireJyxyTService;
import com.auxgroup.hr.front.service.hireperson.HireOutfTService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 竞业协议服务
 *
 * @author tongqian.ni
 * @version $Id: HireJyxyTServiceImpl, v 0.1  2019-01-04.
 */
@Service("hireJyxyTService")
public class HireJyxyTServiceImpl implements HireJyxyTService {
    private static final Logger logger = LoggerFactory.getLogger(HireJyxyTServiceImpl.class);

    @Autowired
    private PsCHireJyxyTRepository psCHireJyxyTRepository;
    @Override
    public PsCHireJyxyT getByHire(String hireId) {
        return psCHireJyxyTRepository.findOne(hireId);
    }

    @Override
    public PsCHireJyxyT save(PsCHireJyxyT jyxy) {
        ObjectFieldUtils.handleNullValue(jyxy);
        return psCHireJyxyTRepository.save(jyxy);
    }
    @Override
    public Boolean delete(String rsHireId) {
        try {
            psCHireJyxyTRepository.delete(rsHireId);
        } catch (Exception e) {
            logger.error("delete HireZcgl error: rsHireId={}",rsHireId,e);
            return false;
        }
        return true;
    }

}
